package com.mobi.menu.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

@Controller
@RequestMapping("/loginController")
public class LoginController extends AbstractController{
	
	@RequestMapping(value = "/login", method = RequestMethod.POST)
	public @ResponseBody String login(
			@RequestParam String login,
			@RequestParam String password){
		if (!login.equals("")
				&& !password.equals("")){
			return "Success";
		}
		return null;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		
		return new ModelAndView("home");
	}
	

}
	